using System;
using System.Collections.Generic;
using System.Text;
using System.Reflection; 
using NUnit.Framework;
using HermesPortal.Core; 
namespace HermesPortal.NUnit
{
    [TestFixture] 
    public class CovenantServicesTestFixture
    {
        private const int TESTCOVENANTID = 1;
        [Test]
        public void GetCovenant()
        {
           Covenant cov = CovenantServices.GetCovenant(TESTCOVENANTID);
           Assert.IsNotNull(cov);
           
           ViewBusinessObjectProperties(cov);
        }
        private void ViewBusinessObjectProperties(object obj)
        {
           Type objType = obj.GetType();
           PropertyInfo [] props  = objType.GetProperties();
           foreach (PropertyInfo prop in props)
          { 
              FieldInfo fi = objType.GetField(prop.Name);
               Console.WriteLine(prop.Name+ ": " + prop.GetValue(obj,null));   
          }
        }
    }
}
